//
//  E7ZoomLayer.h
//  e7engine
//
//  Created by cc on 12-3-8.
//  Copyright (c) 2012年 PalmGame. All rights reserved.
//

#ifndef e7engine_E7ZoomLayer_h
#define e7engine_E7ZoomLayer_h

#include "E7BaseDefine.h"

class CE7ZoomLayer : public CCLayer
{
public:
    CE7ZoomLayer() ;
    ~CE7ZoomLayer() ;

    void RegCallBackFunc(TouchedCallBack singlefunc, TouchedCallBack doublefunc) ;
    void LoadRes(CCLayer* pGame, CCSize texturesize, CCLayer* pBack) ;
    void Reset() ;
    void SetTextureSize(CCSize texturesize) { m_sTextureSize = texturesize ; }

	// a selector callback
	virtual void menuCloseCallback(CCObject* pSender) ;
    virtual void step(ccTime dt) ;

//    void OnNext() ;
//    void OnBack() ;

    virtual void ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) ;
    virtual void ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent) ;
    virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) ;
    virtual void ccTouchesCancelled(CCSet*pTouches, CCEvent *pEvent) ;

	LAYER_NODE_FUNC(CE7ZoomLayer) ;

private:
    void ScaleAction() ;

private:
    CCLayer*           m_pBackS ;
    CCLayer*           m_pGameS ;
    float              m_fTouchStart ;
    float              m_fTouchEnd ;
    bool               m_bIsTouch ;

    CCSize             m_sWinSize ;
    CCSize             m_sTextureSize ;

    bool               m_bIsReged ;
    TouchedCallBack    m_funcSingleTouched ;
    TouchedCallBack    m_funcDoubleTouched ;
    CCPoint            m_posS ;
    CCPoint            m_posE ;
    struct timeval     m_tS ;
    struct timeval     m_tE ;

    bool               m_bIsAction ;
    float              m_fTargetScale ;
};

#endif























